from typing import *


class Solution:
    def new21Game(self, n: int, k: int, maxPts: int) -> float:
        dp = [0] * (k + maxPts)

        for i in range(1, k + maxPts):
            s = max(0, i - maxPts - 1)
            e = min(i - 1, k - 1)
            dp[i] = (i <= maxPts) + dp[e] - dp[s] + dp[i - 1]
        print(dp)
        print(dp[n], dp[-1], dp[n] / dp[-1])
        # return dp[n] / dp[-1]


s = Solution()
print(s.new21Game(10, 1, 10))
print(s.new21Game(2, 2, 6))
